<template>
    <view class="reject-container">
        <image class="icon" src="/static/images/reject.png" mode="aspectFit" />
        <view class="title">入驻申请被拒绝</view>
        <view class="reason">原因：{{ reason }}</view>
        <button class="retry-btn" type="primary" @click="goApply">重新提交申请</button>
    </view>
</template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'

const reason = ref('')

onLoad((query) => {
    reason.value = decodeURIComponent(query.reason || '')
})

function goApply() {
    uni.redirectTo({ url: `/pages/entry/apply?resubmit=1&reason=${encodeURIComponent(reason.value)}` })
}
</script>

<style lang="scss" scoped>
.reject-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #fff;
}

.icon {
    width: 120px;
    height: 120px;
    margin-top: 80px;
    margin-bottom: 30px;
}

.title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #d9534f;
}

.reason {
    font-size: 16px;
    color: #d9534f;
    margin-bottom: 32px;
    text-align: center;
    padding: 0 24px;
}

.retry-btn {
    width: 80vw;
    max-width: 320px;
    font-size: 18px;
}
</style>